"""modify_chat_history_add_project_id

Revision ID: eec7242b3a9b
Revises: d74ab2a44600
Create Date: 2025-10-15 14:46:47.904254

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes


# revision identifiers, used by Alembic.
revision: str = "eec7242b3a9b"
down_revision: Union[str, None] = "d74ab2a44600"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("chat_history", sa.Column("project_id", sqlmodel.sql.sqltypes.AutoString(), nullable=True))
    op.create_index(op.f("ix_chat_history_project_id"), "chat_history", ["project_id"], unique=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_chat_history_project_id"), table_name="chat_history")
    op.drop_column("chat_history", "project_id")
    # ### end Alembic commands ###
